package com.woniuxy.woniumall.times;

import com.woniuxy.woniumall.service.OrderServcie;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.text.SimpleDateFormat;
import java.util.Date;

//@Component
public class SchedulerTask2 {
    private static final SimpleDateFormat dateFormat =
            new SimpleDateFormat("HH:mm:ss");

    //@Autowired
    OrderServcie orderServcie ;

    /**
     * @Description 设置没6秒执行一次
     * @Param
     * @return void
     **/
    @Scheduled(fixedRate = 6000)
    private void process(){
        //执行  需要 5分钟 才能执行完 fixedDelay=6000
        System.out.println("now time is " + dateFormat.format(new Date()));
    }
}
